<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qtquick-connection-editor.qdoc -->
  <title>Adding Connections | Qt Creator Manual</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="index.html">Qt Creator Manual</a></td><td >Adding Connections</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="index.html">Qt Creator Manual 4.11.1</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
  <link rel="prev" href="quick-states.html" />
  <link rel="next" href="quick-signals.html" />
<p class="naviNextPrevious headerNavi">
<a class="prevPage" href="quick-states.html">Adding States</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="quick-signals.html">Connecting Objects to Signals</a>
</p><p/>
<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Adding Connections</h1>
<span class="subtitle"></span>
<!-- $$$qmldesigner-connections.html-description -->
<div class="descr"> <a name="details"></a>
<p>The user interface components and the application need to communicate with each other. For example, a button needs to know that the user has clicked on it. The button may then change color to indicate its state or perform an action. Further, the application needs to know whether the user is clicking the button, because it may need to relay this clicking event to other applications.</p>
<p>QML has a signal and handler mechanism, that enables components to respond to application events. Events are represented by <i>signals</i>. When a signal is emitted, the corresponding <i>signal handler</i> is invoked to respond to the event by using scripts or other operations placed in the handler.</p>
<p>To access a signal outside of the object that emits it, you can use the <a href="http://doc.qt.io/qt-5/qml-qtqml-connections.html">Connections</a> type for connecting to signals of arbitrary objects. A Connections object can receive any signal from its specified target.</p>
<p>A component's property can be assigned a static value which stays constant until it is explicitly assigned a new value. However, to make the fullest use of QML and its built-in support for dynamic object behaviors, most QML types use property bindings. This means that you can specify relationships between different object properties so that when a property's sependencies change in value, the property's value is automatically updated accordingly.</p>
<p>Behind the scenes, the QML engine monitors the property's dependencies (that is, the variables in the binding expression). When a change is detected, the QML engine re-evaluates the binding expression and applies the new result to the property.</p>
<p>The following sections describe how to use the <b>Connections</b> view to perform the following tasks:</p>
<ul>
<li><a href="quick-signals.html">Connecting Objects to Signals</a></li>
<li><a href="quick-dynamic-properties.html">Specifying Dynamic Properties</a></li>
<li><a href="quick-property-bindings.html">Adding Bindings Between Properties</a></li>
<li><a href="quick-connections-backend.html">Managing C++ Backend Objects</a></li>
</ul>
<p>For an example of using properties, bindings, and connections to create a scalable push button, see <a href="quick-scalable-image.html">Creating Scalable Buttons and Borders</a>.</p>
</div>
<!-- @@@qmldesigner-connections.html -->
<p class="naviNextPrevious footerNavi">
<a class="prevPage" href="quick-states.html">Adding States</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="quick-signals.html">Connecting Objects to Signals</a>
</p>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
